package com.entity;

// Generated 06.04.2014 23:28:11 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Notification generated by hbm2java
 */
@Entity
@Table(name = "notification", catalog = "jiraexcel")
public class NotificationEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Integer idNotification;
	private IssueEntity issue;
	private UserEntity user;
	private Date lastNotificationDate;
	private Boolean lastNotificationResult;

	public NotificationEntity() {
	}

	public NotificationEntity(IssueEntity issue, UserEntity user) {
		this.issue = issue;
		this.user = user;
	}

	public NotificationEntity(IssueEntity issue, UserEntity user,
			Date lastNotificationDate, Boolean lastNotificationResult) {
		this.issue = issue;
		this.user = user;
		this.lastNotificationDate = lastNotificationDate;
		this.lastNotificationResult = lastNotificationResult;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_notification", unique = true, nullable = false)
	public Integer getIdNotification() {
		return this.idNotification;
	}

	public void setIdNotification(Integer idNotification) {
		this.idNotification = idNotification;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "issue_id_issue", nullable = false)
	public IssueEntity getIssue() {
		return this.issue;
	}

	public void setIssue(IssueEntity issue) {
		this.issue = issue;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public UserEntity getUser() {
		return this.user;
	}

	public void setUser(UserEntity user) {
		this.user = user;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_notification_date", length = 19)
	public Date getLastNotificationDate() {
		return this.lastNotificationDate;
	}

	public void setLastNotificationDate(Date lastNotificationDate) {
		this.lastNotificationDate = lastNotificationDate;
	}

	@Column(name = "last_notification_result")
	public Boolean getLastNotificationResult() {
		return this.lastNotificationResult;
	}

	public void setLastNotificationResult(Boolean lastNotificationResult) {
		this.lastNotificationResult = lastNotificationResult;
	}

}
